Skip to content

Include functionality for rearranging algebraic loops to turn certain DAEs into ODEs#1400

Open
agarny wants to merge 153 commits into
cellml:mainfrom
agarny:issue1050
Open

Include functionality for rearranging algebraic loops to turn certain DAEs into ODEs#1400
agarny wants to merge 153 commits into
cellml:mainfrom
agarny:issue1050

Conversation

@agarny
Copy link
Copy Markdown
Contributor

@agarny agarny commented May 25, 2026

Fixes #1050.

RLee64 and others added 30 commits December 12, 2025 13:26
Also changed the name of astMap to variableMap to better reflect what it's actually mapping to
Substituted with std::pair<bool, SymEngine::RCP<const SymEngine::Basic>> use instead
Mostly GPT generated test cases
Test case has been superseded by the newly added test suite to more robustly test for equation rearrangement
Previous system assumed that symengine expressions contained only 0-2 children, but in reality it could be any whole number. This adjusts the existing conversion logic to account for this.
Made it so that we also now consider mathml unary +/- operators
Can now handle unary plus, minus, unary minus, and CN types from AST (which means code now passes Analyser.rearrangeAdditiveEquations)
Had an error at equation 4

Also added brackets to equation comments to make things more clear
Now passes Analyser.rearrangeMultiplicativeEquations
Now covers a greater variety of cases
Symengine is not capable of rearranging trig functions into inverse trig functions (e.g. tan(x) = y cannot become x = atan(y))
Now has better Eq 1 test case and more consistent variable naming
Now supports
- Decimal point values (i.e. doubles)
- Constants (E, pi, and inf)
We need to ensure that there can only be one real solution for each
Some specific things had to be added to handle this
- CN representing integers must be appropriately converted since symengine requires exponentials to be whole numbers
- We need to filter out real from non-real solutions since we assume users will want to ignore the complex domain in most cases
Now assumes left child will always be the non-null component
agarny added 9 commits May 25, 2026 13:34
This has indeed been done "properly" in PR cellml#1390.
They were making the code a bit faster but more difficult to maintain.
…txt`.

The idea is for the library type to be determined by CMake to allow building `test_utils` as static or shared, depending on the project's configuration.
They were making the code a bit faster but more difficult to maintain.
…txt`.

The idea is for the library type to be determined by CMake to allow building `test_utils` as static or shared, depending on the project's configuration.
agarny added 2 commits June 6, 2026 19:27
It looks like now it's not enough to provide `CMAKE_PREFIX_PATH`?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include functionality for rearranging algebraic loops to turn certain DAEs into ODEs

3 participants